package com.credit.management.system.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.credit.management.system.generator.dao.ContractSubMapper;
import com.credit.management.system.jdbc.dao.ContractSubDao;
import com.credit.management.system.model.ContractSub;
import com.credit.management.system.model.Page;
import com.credit.management.system.service.IContractSubService;
@Service
public class ContractSubService implements IContractSubService {
	@Autowired
	private ContractSubMapper contractSubMapper;
	@Autowired
	private ContractSubDao contractSubDao;
	/**
	 * 根据id删除contractSub
	 */
	@Override
	public int deleteByPrimaryKey(Long id) {
		
		return contractSubMapper.deleteByPrimaryKey(id);
	}
	/**
	 * 选择字段插入contractSub
	 */
	@Override
	public int insertSelective(ContractSub contractSub) {
		
		return contractSubMapper.insertSelective(contractSub);
	}
	/**
	 * 根据id查询contractSub
	 */
	@Override
	public ContractSub selectByPrimaryKey(Long id) {
		
		return contractSubMapper.selectByPrimaryKey(id);
	}
	/**
	 * 选择字段修改
	 */
	@Override
	public int updateByPrimaryKeySelective(ContractSub contractSub) {
		
		return contractSubMapper.updateByPrimaryKeySelective(contractSub);
	}
//-------------------------custom-------------------------------------
	/**
	 * 根据合同id查询其所有子合同contract_sub
	 */
	@Override
	public Page findPageContractSubsByContractId(Page page) {
		
		return contractSubDao.findPageContractSubsByContractId(page);
	}
	
}
